<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">





<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="C语言版通讯录,结构体存储通讯录," />










<meta name="description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta name="keywords" content="C语言版通讯录,结构体存储通讯录">
<meta property="og:type" content="article">
<meta property="og:title" content="C语言版通讯录">
<meta property="og:url" content="http://yoursite.com/2018/06/17/C语言实现一般通讯录/index.html">
<meta property="og:site_name" content="Askunix&#39;s Blog">
<meta property="og:description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://p9ff104hp.bkt.clouddn.com/44.png">
<meta property="og:image" content="http://p9ff104hp.bkt.clouddn.com/777777.png">
<meta property="og:updated_time" content="2018-06-21T10:17:50.593Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="C语言版通讯录">
<meta name="twitter:description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta name="twitter:image" content="http://p9ff104hp.bkt.clouddn.com/44.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/06/17/C语言实现一般通讯录/"/>





<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">



<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>










  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice")
  daovoice('init', {
      app_id: "8c28bdbe"
    });
  daovoice('update');
  </script>










  <title>C语言版通讯录 | Askunix's Blog</title>
  
  
  
  <head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">





<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="C语言版通讯录,结构体存储通讯录," />










<meta name="description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta name="keywords" content="C语言版通讯录,结构体存储通讯录">
<meta property="og:type" content="article">
<meta property="og:title" content="C语言版通讯录">
<meta property="og:url" content="http://yoursite.com/2018/06/17/C语言实现一般通讯录/index.html">
<meta property="og:site_name" content="Askunix&#39;s Blog">
<meta property="og:description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://p9ff104hp.bkt.clouddn.com/44.png">
<meta property="og:image" content="http://p9ff104hp.bkt.clouddn.com/777777.png">
<meta property="og:updated_time" content="2018-06-21T10:17:50.593Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="C语言版通讯录">
<meta name="twitter:description" content="写在前面 C语言通讯录可以用来存储1000个人的信息，每个人的信息包括姓名、年龄、性别、电话、住址,实现基本的增、删、查、改、排序、打印、清空基本功能。">
<meta name="twitter:image" content="http://p9ff104hp.bkt.clouddn.com/44.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/06/17/C语言实现一般通讯录/"/>





<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">



<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>










  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice")
  daovoice('init', {
      app_id: "8c28bdbe"
    });
  daovoice('update');
  </script>










  <title>C语言版通讯录 | Askunix's Blog</title>
  <style>
  .forkme{
 display: none;
 }
  @media (min-width: 768px) {
 .forkme{
 display: inline;
 }
  }
  </style>
</head>


  
  
  
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?e788bb7bb12bdeb68dc9923dc5b7a69a";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

	
	
	
	
	
<a href="https://github.com/askunix" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
	
	
	
	
	
	
	
	
	
	
	
	
	
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Askunix's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">不积跬步无以至千里</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            博客首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于作者
          </a>
        </li>
      
        
        <li class="menu-item menu-item-photo">
          <a href="/photo/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-camera-retro"></i> <br />
            
            相册分享
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签速查
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            文章分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档记录
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/06/17/C语言实现一般通讯录/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="何进鸿">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://7xrvas.com1.z0.glb.clouddn.com/16-4-6/38502140.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Askunix's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">C语言版通讯录</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-06-17T15:09:27+08:00">
                2018-06-17
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/小项目/" itemprop="url" rel="index">
                    <span itemprop="name">小项目</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2018/06/17/C语言实现一般通讯录/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/2018/06/17/C语言实现一般通讯录/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/2018/06/17/C语言实现一般通讯录/" class="leancloud_visitors" data-flag-title="C语言版通讯录">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读量&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             <span></span>
			 </span>
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1,659
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  8
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h4 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h4><blockquote>
<p>C语言通讯录可以用来存储1000个人的信息，<br>每个人的信息包括姓名、年龄、性别、电话、住址,<br>实现基本的增、删、查、改、排序、打印、清空基本功能。</p>
</blockquote>
<hr>
<a id="more"></a>
<p><img src="http://p9ff104hp.bkt.clouddn.com/44.png" alt="图片加载失败"></p>
<h4 id="思路分析"><a href="#思路分析" class="headerlink" title="思路分析:"></a>思路分析:</h4><ul>
<li><p>首先我们可以分三个模块来解决这个问题，第一个模块我们需要一个头文件，这个头文件里可以包含一些相应信息，当实现文件和测试文件包含自己定义的头文件时便可以获得一些相关的信息。所以头文件里应该包括一个结构体，这个结构体里应包含姓名，性别，年龄，电话，住址。同时还可以定义一个结构体，这个结构体里包含通讯录，同时通讯录里人员的计数变量，将通讯录的地址传到别的地方便可以实现对它遍历或者其他操作。</p>
</li>
<li><p>第二个模块便是我们的测试函数，测试函数便可以实现我们的菜单打印，同时由我们接收不同的值便可以实现不同的操作，就是相应的方法的实现，这里很明显可以通过一个switch语句来控制功能选择，用do-while语句来控制重复选择的循环部分。</p>
</li>
</ul>
<ul>
<li>第三个模块便是我们的方法实现的函数，将模块2里定义的类型为通讯录的地址传到各个方法里，这样便可以实现对通讯录的操作。</li>
</ul>
<h4 id="代码实现"><a href="#代码实现" class="headerlink" title="代码实现"></a>代码实现</h4><h5 id="头文件：-lt-contect-h-gt"><a href="#头文件：-lt-contect-h-gt" class="headerlink" title="头文件： &lt;contect.h&gt;"></a>头文件： <code>&lt;contect.h&gt;</code></h5><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once;</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;Windows.h&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;cstdio&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> NAME_MAX 20</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> TEL_MAX 12</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> SEX_MAX 4</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> MAX 1000</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">enum</span>&#123; Exit, Add, Del, Search, Modify, Empty, Sort, Show&#125;;</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">Stu</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">	<span class="keyword">char</span> Name[NAME_MAX];</span><br><span class="line">	<span class="keyword">int</span> Age;</span><br><span class="line">	<span class="keyword">char</span> Tel[TEL_MAX];</span><br><span class="line">	<span class="keyword">char</span> Sex[SEX_MAX];</span><br><span class="line">	<span class="keyword">char</span> Address[<span class="number">50</span>];</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> <span class="title">Stu</span> <span class="title">Stu</span>;</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> <span class="title">Contact</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">	Stu Con[MAX];       <span class="comment">//容量</span></span><br><span class="line">	<span class="keyword">int</span> sz;     <span class="comment">//计数</span></span><br><span class="line">&#125;Contact, *pContact;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">//函数声明</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">InitContact</span><span class="params">(pContact pCon)</span></span>;  <span class="comment">//初始化</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">AddContact</span><span class="params">(pContact pCon)</span></span>;   <span class="comment">//新建</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">ShowContact</span><span class="params">(pContact pCon)</span></span>;  <span class="comment">//打印</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">DelContact</span><span class="params">(pContact pCon)</span></span>;   <span class="comment">//删除</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">SearchContact</span><span class="params">(pContact pCon)</span></span>;   <span class="comment">//查找</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">ModifyContact</span><span class="params">(pContact pCon)</span></span>;    <span class="comment">//修改</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">EmptyContact</span><span class="params">(pContact pCon)</span></span>;    <span class="comment">//清空</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">SortContact</span><span class="params">(pContact pCon)</span></span>;    <span class="comment">//排序</span></span><br></pre></td></tr></table></figure>
<h5 id="函数实现：-contect-cpp"><a href="#函数实现：-contect-cpp" class="headerlink" title="函数实现： contect.cpp"></a>函数实现： <code>contect.cpp</code></h5><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> _CRT_SECURE_NO_WARNINGS 1</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">"contect.h"</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">InitContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	pCon-&gt;sz = <span class="number">0</span>;</span><br><span class="line">	<span class="built_in">memset</span>(pCon-&gt;Con, <span class="number">0</span>, MAX * <span class="keyword">sizeof</span>(Stu));</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">AddContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="built_in">cout</span>&lt;&lt;<span class="string">"请输入联系人姓名："</span>;</span><br><span class="line">	<span class="built_in">cin</span> &gt;&gt; pCon-&gt;Con[pCon-&gt;sz].Name;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"请输入联系人年龄："</span>;</span><br><span class="line">	<span class="built_in">cin</span> &gt;&gt; pCon-&gt;Con[pCon-&gt;sz].Age;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"请输入联系人电话："</span>;</span><br><span class="line">	<span class="built_in">cin</span> &gt;&gt; pCon-&gt;Con[pCon-&gt;sz].Tel;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"请输入联系人性别："</span>;</span><br><span class="line">	<span class="built_in">cin</span> &gt;&gt; pCon-&gt;Con[pCon-&gt;sz].Sex;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"请输入联系人地址："</span>;</span><br><span class="line">	<span class="built_in">cin</span> &gt;&gt; pCon-&gt;Con[pCon-&gt;sz].Address;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"═════联系人 "</span> &lt;&lt; pCon-&gt;Con[pCon-&gt;sz].Name &lt;&lt; <span class="string">" 的信息保存成功════"</span> &lt;&lt; <span class="built_in">endl</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	pCon-&gt;sz++;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">ShowContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"╔═════════════════════════════════════════════════════════════╗"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">printf</span>(<span class="string">"%3s\t%6s\t%2s%16s%8s%20s\n"</span>,<span class="string">"║序号"</span>,<span class="string">"姓名"</span>,<span class="string">"年龄"</span>,<span class="string">"电话"</span>,<span class="string">"性别"</span>,<span class="string">"地址║"</span>);</span><br><span class="line">		<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; pCon-&gt;sz; i++)</span><br><span class="line">		&#123;</span><br><span class="line"></span><br><span class="line">			<span class="built_in">printf</span>(<span class="string">"%3d\t%6s\t%2d%16s%8s%20s\n"</span>,</span><br><span class="line">				i + <span class="number">1</span>,</span><br><span class="line">				pCon-&gt;Con[i].Name,</span><br><span class="line">				pCon-&gt;Con[i].Age,</span><br><span class="line">				pCon-&gt;Con[i].Tel,</span><br><span class="line">				pCon-&gt;Con[i].Sex,</span><br><span class="line">				pCon-&gt;Con[i].Address);</span><br><span class="line"></span><br><span class="line">		&#125;</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"╚═════════════════════════════════════════════════════════════╝"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"温馨提示：输出完成！！！"</span> &lt;&lt; <span class="built_in">endl</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">FindInContact</span><span class="params">(pContact pCon, <span class="keyword">char</span> *ch)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; pCon-&gt;sz; i++)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">if</span> (<span class="built_in">strcmp</span>(pCon-&gt;Con[i].Name,ch) == <span class="number">0</span>)</span><br><span class="line">		&#123;</span><br><span class="line">			<span class="keyword">return</span> i;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> <span class="number">-1</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">DelContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">char</span> ch[<span class="number">20</span>];</span><br><span class="line">	ShowContact(pCon);</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"请输入上面通讯录中要删除联系人的姓名："</span>;</span><br><span class="line">	<span class="built_in">scanf</span>(<span class="string">"%s"</span>, &amp;ch);</span><br><span class="line">	<span class="keyword">int</span> NUM = FindInContact(pCon, ch);</span><br><span class="line">	<span class="keyword">if</span> (<span class="literal">NULL</span> == <span class="number">-1</span>)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"通讯录中没有该联系人！！！"</span>);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">if</span> (NUM &lt;= pCon-&gt;sz &amp;&amp; NUM != <span class="number">-1</span>)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">for</span> (<span class="keyword">int</span> j = NUM; j &lt;= pCon-&gt;sz<span class="number">-1</span>; j++)</span><br><span class="line">		&#123;</span><br><span class="line">			pCon-&gt;sz--;</span><br><span class="line">			pCon-&gt;Con[j] = pCon-&gt;Con[j + <span class="number">1</span>];</span><br><span class="line">			<span class="built_in">printf</span>(<span class="string">"删除成功！！！\n"</span>);</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">SearchContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">char</span> ch[<span class="number">20</span>];</span><br><span class="line">	<span class="built_in">printf</span>(<span class="string">"请输出你要查找联系人的姓名："</span>);</span><br><span class="line">	<span class="built_in">scanf</span>(<span class="string">"%s"</span>, &amp;ch);</span><br><span class="line">	<span class="keyword">int</span> NUM = FindInContact(pCon, ch);</span><br><span class="line">	<span class="keyword">if</span> (NUM != <span class="number">-1</span>)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"╔═════════════════════════════════════════════════════════════╗"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"%3s\t%6s\t%2s%16s%8s%20s\n"</span>, <span class="string">"║序号"</span>, <span class="string">"姓名"</span>, <span class="string">"年龄"</span>, <span class="string">"电话"</span>, <span class="string">"性别"</span>, <span class="string">"地址║"</span>);</span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"%3d\t%6s\t%2d%16s%8s%20s\n"</span>,</span><br><span class="line">			NUM + <span class="number">1</span>,</span><br><span class="line">			pCon-&gt;Con[NUM].Name,</span><br><span class="line">			pCon-&gt;Con[NUM].Age,</span><br><span class="line">			pCon-&gt;Con[NUM].Tel,</span><br><span class="line">			pCon-&gt;Con[NUM].Sex,</span><br><span class="line">			pCon-&gt;Con[NUM].Address);</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"╚═════════════════════════════════════════════════════════════╝"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line"></span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">else</span></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"你要找的联系人不存在\n"</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">ModifyContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">char</span> ch[NAME_MAX];</span><br><span class="line"></span><br><span class="line">	<span class="built_in">printf</span>(<span class="string">"请输入要修改的联系人的姓名："</span>);</span><br><span class="line">	<span class="built_in">scanf</span>(<span class="string">"%s"</span>, &amp;ch);</span><br><span class="line">	<span class="keyword">int</span> NUM = FindInContact(pCon, ch);</span><br><span class="line"></span><br><span class="line">	<span class="keyword">if</span> (NUM != <span class="number">-1</span>)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"╔═════════════════════════════════════════════════════════════╗"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"%3s\t%6s\t%2s%16s%8s%20s\n"</span>, <span class="string">"║序号"</span>, <span class="string">"姓名"</span>, <span class="string">"年龄"</span>, <span class="string">"电话"</span>, <span class="string">"性别"</span>, <span class="string">"地址║"</span>);</span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"%3d\t%6s\t%2d%16s%8s%20s\n"</span>,</span><br><span class="line">			NUM,</span><br><span class="line">			pCon-&gt;Con[NUM].Name,</span><br><span class="line">			pCon-&gt;Con[NUM].Age,</span><br><span class="line">			pCon-&gt;Con[NUM].Tel,</span><br><span class="line">			pCon-&gt;Con[NUM].Sex,</span><br><span class="line">			pCon-&gt;Con[NUM].Address);</span><br><span class="line"></span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"╚═════════════════════════════════════════════════════════════╝"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"请把姓名修改成："</span>);</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">"%s"</span>, pCon-&gt;Con[NUM].Name);</span><br><span class="line"></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"请把年龄修改成："</span>);</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">"%d"</span>, &amp;pCon-&gt;Con[NUM].Age);</span><br><span class="line"></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"请把电话修改成："</span>);</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">"%s"</span>, pCon-&gt;Con[NUM].Tel);</span><br><span class="line"></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"请把性别修改成："</span>);</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">"%s"</span>, pCon-&gt;Con[NUM].Sex);</span><br><span class="line"></span><br><span class="line">		<span class="built_in">printf</span>(<span class="string">"请把地址修改成："</span>);</span><br><span class="line">		<span class="built_in">scanf</span>(<span class="string">"%s"</span>, pCon-&gt;Con[NUM].Address);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">EmptyContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	pCon-&gt;sz = <span class="number">0</span>;</span><br><span class="line">	<span class="built_in">printf</span>(<span class="string">"清空成功！！！\n\n"</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">SortContact</span><span class="params">(pContact pCon)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; pCon-&gt;sz; i++)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">for</span> (<span class="keyword">int</span> j = <span class="number">0</span>; j &lt; pCon-&gt;sz-i<span class="number">-1</span>; j++)</span><br><span class="line">		&#123;</span><br><span class="line">			<span class="keyword">if</span> (<span class="built_in">strcmp</span>(pCon-&gt;Con[j].Name, pCon-&gt;Con[j + <span class="number">1</span>].Name)&gt;<span class="number">0</span>)</span><br><span class="line">			&#123;</span><br><span class="line">				Stu temp;</span><br><span class="line">				temp = pCon-&gt;Con[j];</span><br><span class="line">				pCon-&gt;Con[j] = pCon-&gt;Con[j + <span class="number">1</span>];</span><br><span class="line">				pCon-&gt;Con[j + <span class="number">1</span>] = temp;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h5 id="测试函数：-test-cpp"><a href="#测试函数：-test-cpp" class="headerlink" title="测试函数： test.cpp"></a>测试函数： <code>test.cpp</code></h5><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">"contect.h"</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">menu</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"╔═══════════════════════════════════════════════════╗"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══════════════════  通讯录  ══════════════════════║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══                                             ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══           1.新建           2.删除           ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══           3.查找           4.修改           ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══           5.清空           6.排序           ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══           7.打印           0.退出           ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"║═══                                             ═══║"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">	<span class="built_in">cout</span> &lt;&lt; <span class="string">"╚═══════════════════════════════════════════════════╝"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">test</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	system(<span class="string">"color c"</span>); <span class="comment">//改变背景</span></span><br><span class="line">	Contact my_con;</span><br><span class="line">	InitContact(&amp;my_con);</span><br><span class="line"></span><br><span class="line">	<span class="keyword">int</span> input = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">do</span></span><br><span class="line">	&#123;</span><br><span class="line">		menu();</span><br><span class="line">		<span class="built_in">cout</span> &lt;&lt; <span class="string">"请选择："</span>;</span><br><span class="line">		<span class="built_in">cin</span> &gt;&gt; input;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">switch</span> (input)</span><br><span class="line">		&#123;</span><br><span class="line">		<span class="keyword">case</span> Exit:</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Add:</span><br><span class="line">			AddContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Del:</span><br><span class="line">			DelContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Search:</span><br><span class="line">			SearchContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Modify:</span><br><span class="line">			ModifyContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Empty:</span><br><span class="line">			EmptyContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Sort:</span><br><span class="line">			SortContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">		<span class="keyword">case</span> Show:</span><br><span class="line">			ShowContact(&amp;my_con);</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line">		<span class="keyword">default</span>:</span><br><span class="line">			<span class="built_in">cout</span> &lt;&lt; <span class="string">"选择错误：-&gt;!!!"</span> &lt;&lt; <span class="built_in">endl</span>;</span><br><span class="line">			<span class="keyword">break</span>;</span><br><span class="line">		&#125;</span><br><span class="line">	&#125; <span class="keyword">while</span> (input);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	test();</span><br><span class="line">	<span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h5 id="输出"><a href="#输出" class="headerlink" title="输出"></a>输出</h5><p><img src="http://p9ff104hp.bkt.clouddn.com/777777.png" alt="图片加载失败"></p>
<h4 id="问题思考"><a href="#问题思考" class="headerlink" title="问题思考"></a>问题思考</h4><p>1、改写成链表存储，不同存储结构的区别？</p>
<p>2、动态版通讯录、文件版通讯录设计？</p>
<p>3、编写大型通讯录系统，将通讯录数据存储在数据库中？</p>

      
    </div>
    
    
    
	
	
	
	<div>
  
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>


  
</div>
	
	

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/img/money.png" alt="何进鸿 微信支付"/>
        <p>微信支付</p>
      </div>
    

    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/C语言版通讯录/" rel="tag"><i class="fa fa-tag"></i> C语言版通讯录</a>
          
            <a href="/tags/结构体存储通讯录/" rel="tag"><i class="fa fa-tag"></i> 结构体存储通讯录</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/06/15/TCP建立和断开连接过程（三次握手&四次挥手）/" rel="next" title="TCP连接的建立和关闭过程及相关面试问题详解（三次握手&四次挥手&面试问题）">
                <i class="fa fa-chevron-left"></i> TCP连接的建立和关闭过程及相关面试问题详解（三次握手&四次挥手&面试问题）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/06/21/【编程之美】链表面试题汇总版/" rel="prev" title="【编程之美】链表面试题汇总版">
                【编程之美】链表面试题汇总版 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="http://7xrvas.com1.z0.glb.clouddn.com/16-4-6/38502140.jpg"
                alt="何进鸿" />
            
              <p class="site-author-name" itemprop="name">何进鸿</p>
              <p class="site-description motion-element" itemprop="description">技术汇总、趣事速记</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">5</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">24</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/m0_37925202" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-skype"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:askunix@163.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5729154534/profile?topnav=1&wvr=6" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/timeline" target="_blank" title="JueJin">
                      
                        <i class="fa fa-fw fa-magnet"></i>JueJin</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://twitter.com/yourname" target="_blank" title="Twitter">
                      
                        <i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://youtube.com/yourname" target="_blank" title="YouTube">
                      
                        <i class="fa fa-fw fa-youtube"></i>YouTube</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                推荐阅读
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.runoob.com/" title="RUNOOB.COM" target="_blank">RUNOOB.COM</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.liaoxuefeng.com/category/0013738748415562fee26e070fa4664ad926c8e30146c67000" title="寥雪峰的官方网站" target="_blank">寥雪峰的官方网站</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.csdn.net/m0_37925202" title="say_askunix的博客" target="_blank">say_askunix的博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://iissnan.com/progit/" title="Pro Git简体中文版" target="_blank">Pro Git简体中文版</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.bootcss.com/p/font-awesome/#" title="Font Awesome" target="_blank">Font Awesome</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://ju.outofmemory.cn/" title="聚客·汇聚优秀技术" target="_blank">聚客·汇聚优秀技术</a>
                  </li>
                
              </ul>
            </div>
          

		  
		  
		  
		  
		<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=528478901&auto=0&height=66"></iframe>  
		  
		  
		  
		  
		  
		  
		  
		  
		  
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#写在前面"><span class="nav-number">1.</span> <span class="nav-text">写在前面</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#思路分析"><span class="nav-number">2.</span> <span class="nav-text">思路分析:</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#代码实现"><span class="nav-number">3.</span> <span class="nav-text">代码实现</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#头文件：-lt-contect-h-gt"><span class="nav-number">3.1.</span> <span class="nav-text">头文件： &lt;contect.h&gt;</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#函数实现：-contect-cpp"><span class="nav-number">3.2.</span> <span class="nav-text">函数实现： contect.cpp</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#测试函数：-test-cpp"><span class="nav-number">3.3.</span> <span class="nav-text">测试函数： test.cpp</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#输出"><span class="nav-number">3.4.</span> <span class="nav-text">输出</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#问题思考"><span class="nav-number">4.</span> <span class="nav-text">问题思考</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        

<div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">何进鸿</span>

  
</div>



<!--
  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>

-->







<div class="theme-info">
  <div class="powered-by"></div>
   <i class="fa fa-pencil"></i>
  <span class="post-count">全站共13.1k字</span>
</div>






|| 梦想没了行动  只会变成空想 || 建议PC端浏览
 
 



 
 
 <div>
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

本站总访问量 <span id="busuanzi_value_site_pv"></span> 次&nbsp&nbsp&nbsp
本站访客数<span id="busuanzi_value_site_uv"></span>人次



</div>

 
 
 
 
 
<!--
<div class="powered-by"></div>
	
    <span class="site-uv">
      <i class="fa fa-eye"></i>
	  
      全站访客<span class="busuanzi-value" id="busuanzi_value_site_pv"></span> 次</span>

-->



<!-- 新增访客统计代码 -->
<!--
<div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-balance-scale"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">何进鸿</span>
</div>


<div class="busuanzi-count">
    <script async="" src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="site-uv">
      <i class="fa fa-user"></i>
      访问用户： <span class="busuanzi-value" id="busuanzi_value_site_uv"></span> 人
    </span>
	
-->
	
<!--	
    <div class="powered-by"></div>
	
    <span class="site-uv">
      <i class="fa fa-eye"></i>
	  
      全站访客： <span class="busuanzi-value" id="busuanzi_value_site_pv"></span> 次</span>
-->	
	

	
<!-- 博客字数统计 
    <span class="site-pv">
      <i class="fa fa-pencil"></i>
      全站共： <span class="post-count">13.1k</span> 字
    </span>
</div>
-->
<!-- 新增访客统计代码 END-->



<section class="footer-time">
    <span class="footer__copyright">
    <div>
    <span id="span_dt_dt"> </span>
    <script language="javascript">
      function show_date_time(){
        window.setTimeout("show_date_time()", 1000);
        BirthDay=new Date("6/25/2018 10:56:12");
        today=new Date();
        timeold=(today.getTime()-BirthDay.getTime());
        sectimeold=timeold/1000
        secondsold=Math.floor(sectimeold);
        msPerDay=24*60*60*1000
        e_daysold=timeold/msPerDay
        daysold=Math.floor(e_daysold);
        e_hrsold=(e_daysold-daysold)*24;
        hrsold=Math.floor(e_hrsold);
        e_minsold=(e_hrsold-hrsold)*60;
        minsold=Math.floor((e_hrsold-hrsold)*60);
        seconds=Math.floor((e_minsold-minsold)*60);
        span_dt_dt.innerHTML="Askunix's Blog已运行："+daysold+" 天 "+hrsold+" 小时 "+minsold+" 分 "+seconds+" 秒";
      }
      show_date_time();
    </script>
    </div>
    <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
</section>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: '8rbOzLF6j6mMuBvuRBuOLq5O-gzGzoHsz',
        appKey: '4PbGi909IHAsoIarzl5ryvrA',
        placeholder: '来啊，快活啊~',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("O8NSjM7KSnPoDYSlBbd2lqfX-gzGzoHsz", "19z7omdx78LwKxzBHxrOskhe");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  
  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
  
  

  
  
  
 
<script type="text/javascript"
color="0,0,255" opacity='0.7' zIndex="-2" count="99" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>

  
  
  
  
  
</body>
</html>
